/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jymsg;

import java.io.IOException;
import java.net.MalformedURLException;
import java.io.InputStreamReader;
import java.io.BufferedReader;


/**
 *
 * @author daniels
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
            throws IOException, BadYahooPacketException, MalformedURLException,
            UsernameOrPasswordMissingException, UsernameHasAtCharException,
            UsernameOrPasswordIncorrectException, SecurityLockForTooManyFaildLoginException,
            SecurityLockException, AccountDeactivatedException, 
            UsernameDoesNotExistsException, CrumbSomethingWrongException {
        
        InputStreamReader converter = new InputStreamReader(System.in);
        BufferedReader in = new BufferedReader(converter);

        YahooSession ysession = new YahooSession();
        ysession.login("username", "password");

        while (ysession.isConnected()) {
            System.out.print("Who: ");
            String who = in.readLine();

            System.out.print("Message: ");
            String message = in.readLine();

            ysession.sendMessage(who, message);
        }
    }

}
